GATE CSE 2000


Q1.

The most appropriate matching for the following pairs is: \begin{array}{ll} \text{X: Indirect addressing} & \text{1: Loops } \\ \text{Y: Immediate addressing } & \text{2: Pointers} \\ \text{Z: Auto decrement addressing } & \text{3: Constants } \\ \end{array}
GateOverflow

Q2.

Consider the following C declaration: struct ( short x[5]; union { float y; long z; } u; )t; Assume that the objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment consideration, is:
GateOverflow

Q3.

Aliasing in the context of programming languages refers to
GateOverflow

Q4.

The most appropriate matching for the following pairs is: \begin{array}{|ll|ll|}\hline X: & \text{m = malloc(5); m = NULL;} & 1: & \text{using dangling pointers} \\\hline Y: & \text{free(n); n -> value = 5;} & 2: & \text{using uninitialized pointers} \\\hline Z: & \text{char *p , *p = 'a' ; } & 3: & \text{lost memory} \\\hline \end{array}
GateOverflow

Q5.

The following C declarations: struct node { int i: float j; }; struct node *s[10]; define s to be:
GateOverflow

Q6.

An n \times n array v is defined as follows: v\left[i,j\right] = i - j for all i, j, i \leq n, 1 \leq j \leq n The sum of the elements of the array v is
GateOverflow

Q7.

Suppose you are given an array s[1....n] and a procedure reverse (s, i, j) which reverses the order of elements in s between positions i and j (both inclusive). What does the following sequence do, where 1 \leqslant k \leqslant n: reverse (s, 1, k); reverse (s, k+1, n); reverse (s, 1, n);
GateOverflow

Q8.

Consider the following functions f(n) = 3n^{\sqrt{n}} g(n) = 2^{\sqrt{n}{\log_{2}n}} h(n) = n! Which of the following is true?
GateOverflow

Q9.

Let S be a sorted array of n integers. Let T(n) denote the time taken for the most efficient algorithm to determined if there are two elements with sum less than 1000 in S. Which of the following statement is true?
GateOverflow

Q10.

The minimum number of cards to be dealt from an arbitrarily shuffled deck of 52 cards to guarantee that three cards are from same suit is
GateOverflow